package com.example.demo.controller;

import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.pojo.familymember;
import com.example.demo.service.Fservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/familymember")
public class fController {
    @Autowired
    private Fservice fservice;
    @GetMapping("/page")
    public Page<familymember> page(
            @RequestParam("name") String name,
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size
    ) {
        return fservice.page(current, size, name);
    }
    @PostMapping("/save")
    public boolean save(@RequestBody familymember fy) {
        return Fservice.saveOrUpdateBymember_id(fy);
    }
    @PostMapping("/delete")
    public boolean delete(@RequestBody List<Integer> Ids) {
        return Fservice.deleteBatchIds(Ids);
    }
}